package com.webridge.plm.test;

import java.io.IOException;
import java.util.Enumeration;

import com.infoengine.util.IEException;
import com.infoengine.object.IeObject;
import com.infoengine.object.factory.Group;

public class IETest2 {

    public static void main(String[] args) {
        com.infoengine.SAK.Task task = new com.infoengine.SAK.Task(
                "/ptc/Windchill_11.1/Windchill/tasks/com/webridge/plm/procedureTest.xml");
        try {
            task.invoke();

            Group g = task.getGroup("QueryObjects");

            IeObject ieoRecord;
            for (Enumeration<?> em = g.getGroup().getChildren(); em
                    .hasMoreElements();) {
                ieoRecord = (IeObject) em.nextElement();
                String fname = ieoRecord.getAtt("FNAME").getDatum()
                        .toString();
                String doclink = ieoRecord.getAtt("DOCLINK").getDatum()
                        .toString();
                String hashKey = fname + ";" + doclink;
            System.out.println("hashKey:" + hashKey);
            }
        } catch (IEException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
